# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-wurlitzer
pkgver=3.1.1
pkgrel=0
pkgdesc="Capture C-level stdout/stderr in Python"
url="https://github.com/minrk/wurlitzer"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/minrk/wurlitzer/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/wurlitzer-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest test.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
22eb97678bb605686f74ab46688febce7c39a997a14633596aaa27103fb4751bf02da1357f9980fe4f8e0591c56f683e279daebf2c4e966d13b436a048a97d14  py3-wurlitzer-3.1.1.tar.gz
"
